package com.nextbus.model;

public class Prediction {

	private String epochTime;
	private String seconds;
	private String minutes;
	private String isDeparture;
	private String affectedByLayover;
	private String dirTag;
	private String vehicle;
	private String block;
	private String tripTag;
	
	public Prediction(String epochTime, String seconds, String minutes,String isDeparture, 
			String affectedByLayover, String dirTag,String vehicle, String block, String tripTag) {
		this.epochTime = epochTime;
		this.seconds = seconds;
		this.minutes = minutes;
		this.isDeparture = isDeparture;
		this.affectedByLayover = affectedByLayover;
		this.dirTag = dirTag;
		this.vehicle = vehicle;
		this.block = block;
		this.tripTag = tripTag;
	}
	public Prediction(){}


	public String toString(){
		return "Prediction[minutes="+minutes+",vehicle=" + vehicle + "]";
	}
	public StringBuilder getSpinner(){
		StringBuilder builder=new StringBuilder();
		if(minutes!=null)
		{
			builder.append("<br/>到站时间: <b>").append(minutes).append("</b>");
		}
		if (vehicle != null)
		{
			builder.append("<br/>车辆: <b>").append(vehicle).append("</b>");
		}
		if (isDeparture.equals("true"))
		{
			builder.append("<br />isDeparture:<b>true</b>");
		}
		
		if (affectedByLayover!=null)
		{
			if(affectedByLayover.equals("true"))
			builder.append("<br />affectedByLayover： <b>").append("true").append("</b>");
		}
		
		if (minutes == "0")
		{
			builder.append("<br />Arriving <b>now</b>!");
		}
		builder.append("<br/>");
		return builder;
	}
}
